'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _graphql = require('graphql-compose/lib/graphql');

const GraphQLDecimal = new _graphql.GraphQLScalarType({
  name: 'Decimal',
  description: 'The 128 bit decimal type. ',
  serialize: String,
  parseValue(value) {
    if (typeof value !== 'string') {
      throw new TypeError('Field error: value is an invalid Decimal');
    }
    return value;
  },
  parseLiteral(ast) {
    return ast.kind === _graphql.Kind.STRING ? ast.value : null;
  }
});

exports.default = GraphQLDecimal;